import { defaultSetting, defaultSeries } from '../setting.js';
function getOpt({
    dataCols = {},
    setting = {}
} = {}) {
    let defaultSet = defaultSetting(dataCols, setting);

    let SetSeries = setting.series || {};
    let lineStyle = SetSeries.lineStyle && Object.keys(SetSeries.lineStyle).length > 0 ? SetSeries.lineStyle : {
        width: 4
    };
    let areaStyle = SetSeries.areaStyle && Object.keys(SetSeries.areaStyle).length > 0 ? SetSeries.areaStyle : {
        normal: {
            opacity: 0.1
        }
    };

    let series = setting.series || {};

    let seriesData = defaultSeries(dataCols, series);
    let option = {
        ...defaultSet,
        series: seriesData
    };
    return option;
}

export default getOpt